import { getToken } from '@/utils/auth'
import store from '@/store'
const userInfo = sessionStorage.userInfo ? JSON.parse(sessionStorage.userInfo) : {};
const jurisdiction = {
  state: {
    cache: userInfo.permissions || ''
  },

  mutations: {
    SET_JURISDICTION: (state, cache) => {
      state.cache = cache;
    }
  },

  actions: {
    GetJurisdictionCache({ commit }) {
      commit('SET_JURISDICTION', JSON.parse(getToken()).permissions);
    }
  }
};

export default jurisdiction
